package com.randb.easyhttp.func;

import com.randb.easyhttp.exception.ApiException;

import io.reactivex.Observable;
import io.reactivex.functions.Function;

/**
 * User: RandBII
 * Date: 2020/5/9
 * Description:
 */
public class HttpResponseFunc<T>  implements Function<Throwable, Observable<T>> {
    @Override
    public Observable<T> apply(Throwable throwable) throws Exception {
        return Observable.error(ApiException.handleException(throwable));
    }
}
